home *** CD-ROM | disk | FTP | other *** search
- Path: edmr54.ccinet.ab.ca!user
- From: d_martin@biomira.com (Douglas Martin)
- Newsgroups: comp.lang.c++,comp.lang.c
- Subject: Re: compiling problem under g++
- Date: 4 Apr 1996 22:56:33 GMT
- Organization: Biomira Inc.
- Message-ID: <d_martin-0404961602210001@edmr54.ccinet.ab.ca>
- References: <3161A2D3.7D84@psu.edu> <4jtsdm$hba@nadine.teleport.com>
- NNTP-Posting-Host: edmr54.ccinet.ab.ca
-
- In article <4jtsdm$hba@nadine.teleport.com>, GHouck <hksys@teleport.com> wrote:
-
- > "Jason A. Soloff" <jas251@psu.edu> wrote:
- ...
- > >
- > >OK... thats it... nice and simple huh? Nope.
- > >Won't compile on two unix systems I am trying to work with...
- > >SunOS 4.1.3_U1, with g++ 2.4 It can't seem to find the
- > >sqrt code from the library? Am I missing something? is the
- > >library called something else under UNIX?
- >
- > Jason,
- >
- > If the '25' is truly an integer, perhaps that is the
- > problem, since there probably is no function available
- > to take the square root of an integer, but rather
- > a double. Unless, of course, it casts it, then ...
- >
- He said it couldn't find the code in the library, not that he got an error
- during compile time! In any case, the prototype for sqrt in <math.h> will
- ensure that the 25 gets coverted to a float.
-
- In answer to the original question, you need to get the math library
- linked in; you probably didn't request it on the g++ command line
- (probably with -lm if it's like cc's I've used; check your man or info
- pages).
-
- --
- Douglas Martin d_martin@biomira.com
- Clinical Support Programmer dmartin@freenet.edmonton.ab.ca
- Biomira Inc.
- 2011 - 94 St. Edmonton
-